package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.SpecialScoreDao;
import cn.topevery.garden.entity.po.SpecialScore;
import cn.topevery.garden.entity.query.SpecialScoreQuery;
import cn.topevery.garden.entity.vo.SpecialScoreVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 特殊分数
 */
@Service
public class SpecialScoreLogic extends BaseLogic<SpecialScore> {
    @Autowired
    SpecialScoreDao specialScoreDao;

    @Override
    public BaseEntityDao<SpecialScore, Integer> getDao() {
        return specialScoreDao;
    }


    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<SpecialScoreVO> listPage(SpecialScoreQuery query) {
        return specialScoreDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId, Integer[] ids) {
        specialScoreDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param specialScore 实体
     */
    public void saveOrUpdate(String userId, SpecialScore specialScore) {
        specialScoreDao.saveOrUpdate(userId, specialScore);
    }

    /**
     * 根据自定义列值来获取对象
     */
    public SpecialScore getEntityByColumn(String key, String value) {
        return specialScoreDao.getEntityByColumn(key, value);
    }
}
